<div id="tb<?php echo $uniqid;?>" style="padding:5px">
	<table cellSpacing="0" cellPadding="0">
		<tbody>
		<tr>
			<td><span style="line-height:30px;">日期</span>
				<input id="rechargeuserlistStartOn" style="width:152px" type="text"
					   className="easyui-datetimebox"> </input>至
				<input id="rechargeuserlistEndOn" style="width:152px" type="text"
					   className="easyui-datetimebox"> </input>
			</td>
			<td><a href="javascript:void(0);" onClick="rechargeuserlistSearch();"
				   className="l-btn l-btn-small l-btn-plain"><span
					className="l-btn-left l-btn-icon-left"><i className="iconfont icon-sousuo"></i><span
					className="l-btn-text">查询</span></span></a></td>
			<td><a href="javascript:void(0);" onClick="rechargeuserlistReset();"
				   className="l-btn l-btn-small l-btn-plain"><span
					className="l-btn-left l-btn-icon-left"><i className="iconfont icon-shuaxinrefresh39"></i><span
					className="l-btn-text">重置</span></span></a></td>
			<td><a href="javascript:void(0);" onClick="rechargeuserlistReload();"
				   className="l-btn l-btn-small l-btn-plain"><span
					className="l-btn-left l-btn-icon-left"><i className="iconfont icon-shuaxin"></i><span
					className="l-btn-text">重载</span></span></a></td>

<!--			<td><span className="l-btn-text">总储备金<?php echo $zong;?></span></td>-->
<!--			<td><a href="javascript:void(0);" onClick="userRecharge();" className="l-btn l-btn-small l-btn-plain"><span-->
<!--					className="l-btn-left l-btn-icon-left"><i className="iconfont icon-tianjia1"></i><span-->
<!--					className="l-btn-text">转入返利金</span></span></a></td>-->
<!--			<td>-->

		</tr>
		</tbody>
	</table>
</div>
<div className="con" style="-moz-user-select:none;">
	<table id="rechargeuserlist"></table>
</div>
<div id="rechargeuserlistdlg" className="easyui-dialog" style="width:840px; height:520px;" title="信息框"
	 closed="true"></div>
<script>
	var rechargeuserlistReload = function () {
		$("#rechargeuserlist").datagrid('reload');
	};
	var userRecharge = function (mode) {

		let title = '月订单统计';
		$("#rechargeuserlistdlg").dialog({
			title: title,
			closed: false,
			width: 640,
			height: 320,
			cache: false,
			href: '/admin/ordermonth/index',
			modal: true,
			buttons: [{
				text: '确定',
				id: 'memberrechargesubmit',
				iconCls: 'icon-ok',
			}, {
				text: '关闭',
				iconCls: 'icon-no',
				handler: function () {
					$("#rechargeuserlistdlg").dialog('close');
				}
			}]
		});

	};

	var rechargeuserlistReset = function () {
		$('#rechargeuserlistKeywords').val('');
		$('#tb<?php echo $uniqid;?> #rechargeuserlistStartOn').datetimebox('setValue', '');
		$('#tb<?php echo $uniqid;?> #rechargeuserlistEndOn').datetimebox('setValue', '');
		rechargeuserlistSearch();
	};
	var rechargeuserlistSearch = function () {
		var height = $(window).height() - $(".top").height() - 46;
		var width = $(window).width() - $(".leftmenu").width() - 8;
		$("#rechargeuserlist").datagrid({
			title: '月订单数据',
			width: width,
			height: height,//高度
			singleSelect: true,//如果为true，则只允许选择一行
			striped: true,//是否显示斑马线效果。
			rownumbers: false,//如果为true，则显示一个行号列。
			pagination: true,//是否显示分页
			pageSize: 10,
			pageList: [10, 15, 20, 25],
			method: 'post',
			sortName: 'id',
			sortOrder: 'desc',
			idField: 'id',
			url: '/admin/ordermonth/index',
			queryParams: {
				keywordsType: $('#rechargeuserlistKeywordsType').val(),
				keywords: $('#rechargeuserlistKeywords').val(),
				start_on: $('#rechargeuserlistStartOn').val(),
				end_on: $('#rechargeuserlistEndOn').val(),
				status: $('#rechargeuserlistStatus').val(),
			},
			fitColumns: true,//真正的自动展开/收缩列的大小，以适应网格的宽度，防止水平滚动。
			nowrap: true,//如果为true，则在同一行中显示数据。设置为true可以提高加载性能。 是否换行
			selectOnCheck: false,
			checkOnSelect: true,
			toolbar: '#tb<?php echo $uniqid;?>',
			columns: [[
				{field: 'id', title: 'ID', width: fixWidth(5)},
				{field: 'money', title: '变更金额', width: fixWidth(10)},
				{field: 'num', title: '订单数量', width: fixWidth(10)},
				{field: 'created_at', title: '录入时间', width: fixWidth(10)},
				{field: 'updated_at', title: '更新时间', width: fixWidth(10)},
			]],
		});
	};
	onDatagridResize("#rechargeuserlist");
	rechargeuserlistSearch();
</script>
